package cn.tedu.spring.bean;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author 董代恒
 * @version 1.0
 */
public class TestUserDao {
    public static void main(String[] args) {
        //1.创建Ioc容器
        ApplicationContext context = new AnnotationConfigApplicationContext("cn.tedu.spring.bean");
        //2.获取bean对象
        UserService userService = context.getBean(UserService.class);
        //3.打印bean对象地址

        System.out.println(userService);
    }
}
